const Mock = require('mockjs')

const data2 = Mock.mock({
  chipId: '@id',
  name: '@title(5, 10)',
  supplier: '@title(1, 3)',
  chip_no: +Mock.Random.date('T'),
  raycus_no: +Mock.Random.date('T'),
  incoming_time: '@datetime',
  special_requirements: '无',
  params: {
    photoelectric_parameter: [
      { pId: 7, item: '光电参数', parameter: '阈值电流', symbol: 'Ith', unit: 'A', test_condition: '20℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 8, item: '光电参数', parameter: '工作电流', symbol: 'Iop', unit: 'A', test_condition: '20℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '光电参数', parameter: '工作功率', symbol: 'Pop', unit: 'W', test_condition: '20℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '光电参数', parameter: '工作电压', symbol: 'Vop', unit: 'V', test_condition: '20℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '光电参数', parameter: '斜效率', symbol: 'η', unit: 'W/A', test_condition: '20℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '光电参数', parameter: '电光转换效率', symbol: 'ηtot', unit: '%', test_condition: '20℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '光电参数', parameter: '冷波长', symbol: 'λpulse', unit: 'nm', test_condition: '20℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '光电参数', parameter: '慢轴发散角', symbol: 'Θ‖', unit: '°', test_condition: '20℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '光电参数', parameter: '快轴发散角', symbol: 'Θ┴', unit: '°', test_condition: '20℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '光电参数', parameter: '光谱宽度', symbol: 'Δλ', unit: 'nm', test_condition: '20℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '光电参数', parameter: '偏振模式', symbol: 'PERM', unit: '/', test_condition: '20℃', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '光电参数', parameter: '偏振度', symbol: 'PER', unit: '%', test_condition: '20℃', min_value: '0', typical_value: '5', max_value: '10' }
    ],
    structure_parameter: [
      { pId: 9, item: '结构参数', parameter: '腔长', symbol: 'L', unit: 'um', test_condition: '', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '结构参数', parameter: '厚度', symbol: 'H', unit: 'um', test_condition: '', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '结构参数', parameter: '宽度', symbol: 'W', unit: 'um', test_condition: '', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 9, item: '结构参数', parameter: '发光点宽度', symbol: 'EmW', unit: 'um', test_condition: '', min_value: '0', typical_value: '5', max_value: '10' },
      { pId: 10, item: '结构参数', parameter: 'bar条点数', symbol: 'DieNo', unit: '', test_condition: '', min_value: '0', typical_value: '5', max_value: '10' }
    ]
  }
})

module.exports = [
  {
    url: '/chip/spec',
    type: 'get',
    response: config => {
      const { chipId } = config.query
      console.log(chipId)
      return {
        code: 0,
        data: data2
      }
    }
  }
]

